var objAjax = {};

//请求ajax通用方法,params为参数,type为dataType类型,fn回调
objAjax.commonFn = function(params,url,type,fn){
	var data;
	if(params){
		data = params;
	}else{
		data = null;
	}
	$.ajax({
		type:type,
		url:url,
		data:{newsjson:JSON.stringify(data)},
		dataType:"json",
		success:function(data){
			fn(data);
		},
		error:function(){
			alert("网络繁忙，请重试！");
		}
	});
}

objAjax.commonMulityFn = function(params,url,type,fn){
	var data;
	if(params){
		data = params;
	}else{
		data = null;
	}
	$.ajax({
		type:type,
		url:url,
		data:{heapjson:JSON.stringify(data)},
		dataType:"json",
		success:function(data){
			fn(data);
		},
		error:function(){
			alert("网络繁忙，请重试！");
		}
	});
}

